using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;

public class SetButtom : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
    public Button Button;
    public GameObject describeUI;
    public GameObject useUI;

    private bool useUIIsActice = false;

    //鼠标进入
    public void OnPointerEnter(PointerEventData eventData)
    {
        describeUI.SetActive(true);
    }

    //鼠标离开
    public void OnPointerExit(PointerEventData eventData)
    {
        describeUI.SetActive(false);
    }

    //鼠标点击时
    public void OnClick()
    {
        if (!useUIIsActice)
        {
            useUI.SetActive(true);
            useUIIsActice = true;
        }else if (useUIIsActice)
        {
            useUI.SetActive(false);
            useUIIsActice = false;
        }
    }
}